﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using StaticPlugin;

namespace testplugin1
{
    public class sJob /*: AJob*/ 
    {
        protected /*override*/ string getName() { return "Покупка кирки"; }
        public void CheckStatus(WebBrowser b)
        {
            Console.WriteLine("Checking status in sJob");
        }
        public void BuyKirka(WebBrowser b)
        {
            Console.WriteLine("Buying kirka in sJob");
        }

        public sJob()
        {
            initActions();
            
        }

        /// <summary>
        /// проверяет необходимость начать выполнение
        /// </summary>
        /// <param name="browser"></param>
        /// <returns>если ДА необходимо активировать работу</returns>
        public /*override */bool testRequirements(WebBrowser browser)
        {
            return false;
        }

        public /*override*/ DialogResult showSetupDialog()
        {
            sJobSetup s = new sJobSetup(this);
            DialogResult r = s.ShowDialog();
            if (r == DialogResult.OK) Console.WriteLine("active=" + active.ToString());
            return r;
        }

        protected /*override*/ string getStatus()
        {
            return "Idle";
        }

        public /*override*/ void initActions()
        {
            //actions.Add(new Action("Проверка статуса", CheckStatus));
            //actions.Add(new Action("Покупка кирки", BuyKirka));
        }
        
        public bool active = true;

        protected /*override*/ bool getAvailable()
        {
            return active;
        }

        protected /*override*/ int getPriority()
        {
            return 10;
        }
    }
}
